import java.util.Arrays;
import java.lang.Math.*;
import java.io.*;

class NeighbourNumbers {

	private int[] inputNumbers = {1, 1, 2, 3, 5, 8, 13, 21, 34};
	
	public NeighbourNumbers(){
		try{
			inputNumbers = new ConsoleReaderUtility().
							readIntegerArray("Enter set of integer numbers (numbers should be separated by spaces): ");
		}
		catch (IOException e) {
			System.out.println("There was an exception trying to read a provided array... The default one will be used "+this.toString());
		}
	}
	
	public static void main(String[] args) throws Exception{
		NeighbourNumbers neighbourNumbersTester = new NeighbourNumbers();
		int[] currentNumbersSet = neighbourNumbersTester.getInputNumbers();
		
		if(currentNumbersSet.length<=1) System.out.println("You should specify at least two numbers numbers...");
		else if(currentNumbersSet.length==2) System.out.println("There are only two elements, so the index is 0...");
		else System.out.println("The index is "+neighbourNumbersTester.analyzeArray());
	}
	
	public String toString(){
		return Arrays.toString(inputNumbers);
	}
	
	public int analyzeArray(){
		int currentMaxDeviation = Integer.MAX_VALUE;
		int result = 0;
		for (int currentIndex=1; currentIndex<inputNumbers.length; currentIndex++){
			if(Math.abs( inputNumbers[currentIndex]-inputNumbers[currentIndex-1] ) < currentMaxDeviation){
				currentMaxDeviation = Math.abs(inputNumbers[currentIndex]-inputNumbers[currentIndex-1]);
				result = currentIndex-1;
			}
		}
		return result;
	}
	
	private int[] getInputNumbers(){
		return inputNumbers;
	}
	
}